package com.dnzx.model;

import java.util.Date;
import java.util.List;

import org.apache.ibatis.type.Alias;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 订单
 */
@Alias("orderBO")
@ApiModel(value = "Order 订单BO")
public class OrderBO extends BaseBO {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "订单号")
	private String sn;
	@ApiModelProperty(value = "发票类型 1-无需发票；2-电子普通票个人抬头；3-电子普通票企业抬头")
	private String invoiceType;
	@ApiModelProperty(value = "下单时间")
	private Date orderTime = new Date();
	@ApiModelProperty(value = "用户ID")
	private Long userId;
	@ApiModelProperty(value = "付款方式")
	private String paymentType;
	@ApiModelProperty(value = "订单金额")
	private double amt;
	@ApiModelProperty(value = "状态")
	private String status;
	@ApiModelProperty(value = "姓名")
	private String name;
	@ApiModelProperty(value = "公司名称")
	private String companyName;
	@ApiModelProperty(value = "电话")
	private String mobile;
	@ApiModelProperty(value = "送货地址")
	private String address;
	@ApiModelProperty(value = "电子邮箱")
	private String email;
	@ApiModelProperty(value = "证件类型")
	private String cardType;
	@ApiModelProperty(value = "证件号码")
	private String cardNo;
	@ApiModelProperty(value = "客户类型：个人或者客户")
	private String customerType;
	@ApiModelProperty(value = "企业注册名称")
	private String companyRegisterName;
	@ApiModelProperty(value = "纳税人识别号")
	private String taxNo;
	@ApiModelProperty(value = "付款凭单")
	private String paymentUrl;
	
	@ApiModelProperty(value = "图片地址")
	private String picUrl;
	
	@ApiModelProperty(value = "商品明细ID")
	private List<Long> itemList;
	
	// 以下非数据库字段
	@ApiModelProperty(value = "用户名")
	private String userName;
    @ApiModelProperty(value = "开始时间")
    private String startTime;
    @ApiModelProperty(value = "结束时间")
    private String endTime;
    @ApiModelProperty(value = "状态")
	private String statusName;
    
    @ApiModelProperty(value = "商品明细对象")
	private List<OrderItemBO> orderItemBOList;

	public String getSn() {
		return sn;
	}

	public void setSn(String sn) {
		this.sn = sn;
	}

	public String getInvoiceType() {
		return invoiceType;
	}

	public void setInvoiceType(String invoiceType) {
		this.invoiceType = invoiceType;
	}

	public Date getOrderTime() {
		return orderTime;
	}

	public void setOrderTime(Date orderTime) {
		this.orderTime = orderTime;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getPaymentType() {
		return paymentType;
	}

	public void setPaymentType(String paymentType) {
		this.paymentType = paymentType;
	}

	public double getAmt() {
		return amt;
	}

	public void setAmt(double amt) {
		this.amt = amt;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getCardType() {
		return cardType;
	}

	public void setCardType(String cardType) {
		this.cardType = cardType;
	}

	public String getCardNo() {
		return cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	public String getCustomerType() {
		return customerType;
	}

	public void setCustomerType(String customerType) {
		this.customerType = customerType;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getTaxNo() {
		return taxNo;
	}

	public void setTaxNo(String taxNo) {
		this.taxNo = taxNo;
	}

	public String getPaymentUrl() {
		return paymentUrl;
	}

	public void setPaymentUrl(String paymentUrl) {
		this.paymentUrl = paymentUrl;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getStartTime() {
		return startTime;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public String getCompanyRegisterName() {
		return companyRegisterName;
	}

	public void setCompanyRegisterName(String companyRegisterName) {
		this.companyRegisterName = companyRegisterName;
	}

	public List<Long> getItemList() {
		return itemList;
	}

	public void setItemList(List<Long> itemList) {
		this.itemList = itemList;
	}

	public List<OrderItemBO> getOrderItemBOList() {
		return orderItemBOList;
	}

	public void setOrderItemBOList(List<OrderItemBO> orderItemBOList) {
		this.orderItemBOList = orderItemBOList;
	}

	public String getStatusName() {
		if ("1".equals(this.status)) {
//			this.statusName = "未支付";
			this.statusName = "not payment";
		} else if ("2".equals(this.status)) {
//			this.statusName = "已支付";
			this.statusName = "paid";
		}
		return statusName;
	}

	public void setStatusName(String statusName) {
		this.statusName = statusName;
	}

	public String getPicUrl() {
		return picUrl;
	}

	public void setPicUrl(String picUrl) {
		this.picUrl = picUrl;
	}

}

